<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>巴士管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/bus/tCompBus/list?types=${types}">巴士管理列表</a></li>
		<shiro:hasPermission name="bus:tCompBus:edit"><li><a href="${ctx}/bus/tCompBus/form?types=${types}">巴士管理添加</a></li></shiro:hasPermission>
		<li><a href="${ctx}/bus/tCompBus/state?types=${types}">巴士调度情况查询</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="TCompBus" action="${ctx}/bus/tCompBus/list?types=${types}" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<input id="types" name="types" type="hidden" value="${types}"/>
		<ul class="ul-form">
				<c:if test="${types!=1}">
					<li><label>归属公司：</label>
					<form:select path="office" class="input-medium">
					<option value="">--请选择--</option>
					<form:options items="${fns:getOfficeListByFlatType(\"1\")}" itemLabel="name" itemValue="id" htmlEscape="false" />
				</form:select>
						</li> 
				</c:if>
				<li><label>车牌号：</label><form:input path="licenseno" maxlength="50" class="input-medium"/></li>
				<li><label>车辆状态：</label>
				<form:select path="busstatus" class="input-medium">
					<option value="">--请选择--</option>
					<form:options items="${fns:getDictList('cargo_st')}" itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select></li>
				<li><label>手机号：</label>
				<form:input path="ownertel" maxlength="50" class="input-medium"/></li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
	<thead><tr><th>车牌号</th><th>车型</th><th>车辆描述</th>
	<th>可乘座位数</th><th>车辆等级</th><th>车辆状态</th><th>车辆属性</th><shiro:hasPermission name="bus:tCompBus:edit"><th>操作</th></shiro:hasPermission></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="tCompBus">
			<tr>
				<td><a href="${ctx}/bus/tCompBus/formview?id=${tCompBus.busid}&types=${types}">${tCompBus.licenseno}</a></td>
				<td>${tCompBus.cartype.typename}</td>
				<td>${tCompBus.vehiclename}</td>
				<td>${tCompBus.seats}</td>
				<td>${fns:getDictLabel(tCompBus.busclass, 'dbo_vehicle', '无')}</td>
				<td>${fns:getDictLabel(tCompBus.busstatus, 'cargo_st', '无')}</td>
				<td>
					<c:if test="${tCompBus.bustype eq '0'}">公营</c:if>
					<c:if test="${tCompBus.bustype eq '1'}">承包</c:if>
				</td>
				<shiro:hasPermission name="bus:tCompBus:edit"><td>
    				<a href="${ctx}/bus/tCompBus/form?id=${tCompBus.busid}&types=${types}">修改</a>
    				<c:if test="${tCompBus.busstatus == 1 }">
    				<a href="${ctx}/bus/tCompBus/enableBus?id=${tCompBus.busid}&types=${types}" onclick="return confirmx('确认要启用该巴士信息吗？', this.href)">启用</a>
    				</c:if>
    				<c:if test="${tCompBus.busstatus == 0 }">
					<a href="${ctx}/bus/tCompBus/disableBus?id=${tCompBus.busid}&types=${types}" onclick="return confirmx('确认要停用该巴士信息吗？', this.href)">停用</a>
					</c:if>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
	
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>